package com.prd.exception;

import com.prd.enums.ResultCodeEnum;
import lombok.Data;

/**
 * @Author lizhaoyi
 * @date 2023/10/3 20:59
 * Description:
 */
@Data
public class BizException extends RuntimeException {

    private Integer code;
    private String msg;
    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }
    public BizException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
        this.msg = resultCodeEnum.getMessage();
    }
}
